package org.itboys.core.service.mongo.front;

import org.itboys.core.common.SundayCommonConstants;
import org.itboys.core.entity.mongo.SundayTimeConfig;
import org.itboys.mongodb.core.MongoDataSource;
import org.itboys.mongodb.service.BaseMongoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Auther: 罗尧坤
 * Date: 2018/8/16
 * Description: 小程序配送时间段服务类
 */

@Service
public class SundayFrontTimeConfigService extends BaseMongoService<SundayTimeConfig> {
    @Resource(name = "mobileDs")
    private MongoDataSource mongoDataSource;

    @Override
    protected MongoDataSource getMongoDataSource() {
        return mongoDataSource;
    }

    @Override
    protected Class<SundayTimeConfig> getEntityClass() {
        return SundayTimeConfig.class;
    }

    /**
     * 查询时间段
     *
     * @return
     */
    public List<SundayTimeConfig> select() {
        Map<String, Object> param = new HashMap<>();
        param.put("isDeleted", SundayCommonConstants.NO);

        List<SundayTimeConfig> list = super.list(param);

        return list;

    }

}
